{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from scipy.spatial.transform import Rotation as R\n",
    "from astropy import coordinates as ac\n",
    "import copy\n",
    "import torch\n",
    "\n",
    "import os \n",
    "from os.path import join, split,exists, isdir,isfile\n",
    "\n",
    "file_root =  join(os.getcwd(),'..')\n",
    "os.chdir(file_root)\n",
    "\n",
    "from utils.pc_utils import *\n",
    "from utils import * \n",
    "\n",
    "\n",
    "from utils.utils import * \n",
    "import numpy as np \n",
    "\n",
    "\n",
    "from entity.prediction_loader import PredictionLoader\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "prediction_root = '/data1/liyang/semantic_kitti_api-master/datasets/predictions/sequences/08/n19_four_losses_with_shapenet_anomaly'\n",
    "\n",
    "\n",
    "epoch_names= sorted(os.listdir(prediction_root),key=lambda k: int(k.split('_')[-1]))\n",
    "loader = PredictionLoader(join(prediction_root,epoch_names[-1]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "for (pred_pc,uncertainty) in loader:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.99588364, 1.6822581e-09, (122958,))"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "uncertainty.max(),uncertainty.min(),uncertainty.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1052185467, 1052185467, 1052185467, ...,  932465636,  934933608,\n",
       "        934933608], dtype=uint32)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "uncertainty"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "yang_real",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
